#include <iostream>

class Base
{
public:
    Base()
    {
        std::cout<<"父类构造"<<std::endl;
        a++;
    }
public:
    static int a;
};


//静态成员父子类共用
int Base::a = 0;

class Derived:public Base
{
public:
    Derived()
    {
        std::cout<<"子类构造"<<std::endl;
        a++;
    }
};

int main()
{
    Base b;
    Base c;
    Derived d;
    std::cout<<"Base count : "<< Base::a<<std::endl;
    std::cout<<"Derived count : "<< Derived::a<<std::endl;
    return 0;
}